<?php


namespace App\Repositories;


use App\Exceptions\MsgException;
use App\Models\Order;
use App\Models\OrderProduct;
use App\Models\Product;
use App\Services\SoaService;
use App\Services\VehicleService;
use Carbon\Carbon;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Rizhou\Control\Supply\StoreSynchronizing;

class OrderRepository extends Repository
{
    protected $modelClass = Order::class;

    /**
     * 通过订单号获取订单
     * @param $no
     * @return mixed
     */
    public function getByNo($no){
        return $this->model()->whereNo($no)->first();
    }

    /**
     * 通过电话邮箱获取订单
     * @param $phone
     * @param $email
     * @return mixed
     */
    public function getByPhoneEmail($phone,$email){
        return $this->model()->where('email',$email)->where('phone',$phone)->orderBy('id','desc')->first();
    }

    /**
     * 通过姓名電話獲取訂單
     * @param $phone
     * @param $name
     * @return mixed
     */
    public function getByNamePhone($name,$phone){
        return $this->model()->where('name',$name)->orWhere('name_origin',$name)->where('phone',$phone)->orWhere('phone_origin',$phone)->orderBy('id','desc')->first();
    }

    /**
     * 订单生成
     * @param array $data
     * @param array $products
     * @return mixed
     */
    public function store(array $data,$products){




        return DB::transaction(function () use($data,$products) {

            $ip_count = $this->getDayIpOrderCount(VehicleService::IP());

            if($ip_count>=5){
                throw new MsgException("您今日下單數過多，請理性消費！");
            }


            $product_price = $this->countOrderPrice($products);

            $insert_data = [
                'no'=>$this->makeOrderNo(),
                'inside_no'=>$this->makeOrderInsideNo(),
                'ip'=>VehicleService::IP(),
                'user_agent'=>request()->header('user-agent'),
                'product_price'=>$product_price,
                'delivery_type'=>Arr::get($data,'order_type')
            ];

            if(Arr::get($data,'order_type') > 0){
                $store_id = Arr::get($data,'store_id');

                if(!$store_id){
                    throw new MsgException("便利店選擇有誤!");
                }
                $city = Arr::get($data,'city');
                $county = Arr::get($data,'county');
                $street = Arr::get($data,'street');

                if(Arr::get($data,'order_type') == 1){
                    $shop_guard = '711';
                }elseif(Arr::get($data,'order_type') == 2){
                    $shop_guard = 'ezship';
                }else{
                    throw new MsgException("便利店數據有誤！");
                }

                $shops = StoreSynchronizing::make($shop_guard)->getShop($city,$county,$street);

                if(!$shops){
                    throw new MsgException("便利店信息有誤!");
                }
                $shop = [];
                foreach($shops as $item){
                    if($item['shop_no'] == $store_id){
                        $shop = $item;
                        break;
                    }
                }
                if(!$shop){
                    throw new MsgException("便利店信息有誤2!");
                }
                $insert_data['address'] = $shop['shop_address'];
                $insert_data['shop_no'] = $shop['shop_no'];
                $insert_data['shop_name'] = $shop['shop_name'];
                $insert_data['shop_type'] = Arr::get($shop,'shop_type',0)+1;
                $insert_data['shop_data'] = $shop;
            }else{
                $insert_data['address'] = Arr::get($data,'address');
            }

            $freight_where = \App\Services\ConfigService::get('freight_where',0);
            if($product_price>$freight_where){
                $freight = 0;
            }else{
                $freight = \App\Services\ConfigService::get('freight',0);
            }
            $insert_data['freight'] = $freight;
            $insert_data['total_price'] = $freight+$product_price;
            $insert_data2 = Arr::only($data,['name','phone','email','city','county','street','remarks','delivery_time']);
            $insert_data = array_merge($insert_data,$insert_data2);


            /*try {
                set_time_limit(0);
                $ipcountry = request()->header('cf-ipcountry');
                $is_pf = rand(1,10);
                if($ipcountry == 'TW' && $is_pf<=5){
                    $dis_ips = ['103.137','61.222','61.227','111.252','est','test','TEST','Test','策','丹','测试','測試','訂單','订单','1234','9876','5432','4321','5678','testmail','163.com','qq.com'];

                    $is_ts = false;
                    foreach ($dis_ips as $v){
                        if(strpos($insert_data['ip'],$v) !== false || strpos($insert_data['name'],$v) !== false && strpos($insert_data['phone'],$v) !== false || strpos($insert_data['remarks'],$v) !== false){
                            $is_ts = true;
                            break;
                        }
                    }

                    if(!$is_ts){

                        $soa = new SoaService();
                        $soa->name = $insert_data['name'];
                        $soa->phone = $insert_data['phone'];
                        $soa->total_price = $product_price;
                        $soa->goods_price = $product_price;
                        $soa->freight = 0;
                        $soa->delivery_type = Arr::get($data,'order_type');
                        $soa->city = $insert_data['city'];
                        $soa->county = $insert_data['county'];
                        $soa->street = $insert_data['street'];
                        $soa->address = $insert_data['address'];
                        $soa->remarks = $insert_data['remarks'];
                        $soa->ip = $insert_data['ip'];
                        $soa->user_agent = $insert_data['user_agent'];
                        $soa->store_name = isset($insert_data['shop_name'])?$insert_data['shop_name']:'';
                        $soa->store_no = isset($insert_data['shop_no'])?$insert_data['shop_no']:'';

                        $soa->goods = [[
                            'goods_name'=>app('cache.config')->get('site_name'),
                            'unit'=>'盒',
                            'number'=>$products->first()->quantity,
                            'unit_price'=>$product_price,
                            'total_price'=>$product_price,
                        ]];

                        $soa->sendSoa();


                        $insert_data['name_origin'] = $insert_data['name'];
                        $insert_data['phone_origin'] = $insert_data['phone'];

                        $insert_data['phone'] = substr($insert_data['phone_origin'],0,5).rand(10000,99999);

                        $name_str = '峻冠升右蓁江凱煒民瑋冠升長發欽松澤志奕丞志豪天惠何嶽翰盧宏社國豪游榮輝蘇修立宗悅鄭志忠趙立澎學呈劉宏凱洪萌宗永昇保憲穎謙梁家銘延儒彥霖姜篤康開哥學徑尤世雄耿碩益清益清志鴻俊凱俊凱傅朝銘人一趙堉榕鄭雯蔓鐘文蔚子元建民路易江安俊森莊宗祐淑英芷芳清泉旭峰永釧禎福輝嵐丁俊天蔡承志柏勳紫陽沈智威江安董逸書孫盛權一剛賴柏豪碩文鄒奕涵蔡貽泉睿宏惠民宇傑宇傑辛紀宗劉昌鑫曾信雄展瑋國典丁漢錡賴建宇禎福余佳興承興盈瑞簡德隆原讚詠伯季勳曾鐵湖鄭喬文沛然古翊航古翊航沈群哲峻賢ㄧ帆沈金池宸維耀新經上連水聖志堅國豪格岷黎卿詩元智宏趙偉釗顏任成友隆文傑珈民孟毅洪雪恩白博翔萬鎮儀舒天縱睿澤俞永吉志縈子洋志强劉軒宇賴威翰蔡宗城游嘉新錢翰諹欣倫朱永和史奇昌鴻聖梁文乾邱裕翔江建宏維道教授鐘啟元國豪潘駿憲呂寶致緯家浩蔡佳宏蔡佳宏宏昇建樺胡建成顥培都丸正夫昕叡俊達銘天天樂敬道景三友蔡金標之昊朱瑋哲浩翰建承巫勤富耀陞培綸翁信臺廖欽寬子能何品宏群凱劉老虎俊毅銘鴻劉智忠奕民卿睿苡霖裕富代書昭賢鍾和融翰文智成致仁孫強正宗魏貞明允呈桀瑋代書關國雄翔展英綸高明新弘四友駿曾俊峰呂逢仁建璟威言江典霖葉仲倫中元盧恒田明樺鄭傑裕傳孝俊宏馬戴成志意婷一先莊偉程程易達鉦憲倪紹傑子芳育平魏愷美祿洪士弘趙重智珍珍葉江守仁正宏曾鉦能祥年豪祥昱齊君翰志遠盧星學富城廖文華蔣定文曾寈畋古名尊建豪簡志成洪榮隆洪榮隆信誠藍漢騏呂長陽程家瑋廖學醫柏青彤夏文信譚曜葉家宏偉信正賢安藤尹樂群尹樂群世奕億修威廷丁重威瑋坤昇國豪仕杰簡憲志石仁傑尤奕閔小姐永釧冠佑祐辰宋俊慶緯志蔡昆樺禹祥簡于凱蔡宗儒弘典建融賴慶堂彭道衡桂青懿峰粘獻文建良康文源啟斌辜于誠仁宏甘能宇彭冠諭鍾賢達建翰丁重威丁健泰劉建麟鵬誠良釘聲東誌麟榮晟俊成余玄輝簡文萍顏志翔莫東霖淑珍劉育仁登凱傳富志軒仕奇阿仁阿仁永鴻鄭鈞中景裕呂建德凱隆群豪冠峰偉傑蔡碧桐政杰政杰耀龍朱奕地鄭乃國志宏魏俊利傑依璇趙元璟榮德廖宜錚廖育彬淑芬子騰冠廷高瑞鴻瑋潮銓曾啓光曾啓光煥文明儒章勇宣暘建鏵皆亨梁克誠哲安沈小治阿宏馮俊恒士珉古宸維閔超坤維彥全昱安恒志美菁蘇俊生燦輝俊豪蕭宇倫潘冠華游智勤宗翰冠宇孟孟趙長助余昊騰宋泳霖炳綸暐欣姜世光彥凱何彥伯偉傑晏生億則翁怡君以臣柏堯聖傑莫劉余宣修仁穆彥鎮宏中明薛志成曾能奎博印劉俊良蔡智宇仲柏志堯季顯榮冠雄立普鴻飛簡志成家易蔡政達奕新何俊儀偉傑銘財游文祥游文祥柏毅鄭晶尹金鷹鴻飛鴻飛立明葉俊雄奇漢耀宗東樓蔡銘哲晴雯世家廖宏毅杜文彬劉安國原銘卓宜賢余彥彰余彥彰詹薪惟英發英發孫紹傑平星豪明凱劉穎奇永昌孫茂育傅偉傑小春翁群儀益清韓大衛景雲彭道衡聶古渝彭道衡鄧清展益清信仲邱建智開發莊宜勳敏琳嚴振涵葉蓁智翔智翔邱顯鈞木水洪賓志信維御通沈傳家佳助賴泓彰丁重威蔡承達余冠霆冠峰蘇孟斌丁吉峯老麥蔡承志國榮劉庭綸余承蔓筱雯曹睿洋曹睿洋宬風劉俊佑賴賴威宇翁伯凱方柏峰偉傑義偉義偉萬城永傑隺曹清標立明余濟安登傑盧思嘉趙漢宗何國全廷睿長朋健勇儀芬邱詮勝原禾舒涵蕭宗平莊世民志強奕中奕仁連武彥康怡南宥睿蘇俊生歐蕭敬龍琮崴晉倫戴漢廷劉行五孫其瑩簡金科于誠翁漢翔洪瑞鴻良瑄巫坤彬彥帆寬成胡家誠世豪種福奕軒江坤成陸耿男莊玉麟育民義閎潘健全卓奈德慶倫古佳樂拓光鄭正明廖育彬阿燕莊偉程廖宏毅來旺朱建榮朱建榮乃文思翔家銘侑軒子捷龍惠芬葉伯陞振南柯邱建富志成蘇煒璋鳳梧嵩堡詹鵬弘劉軒宇馮朝牧呂承叡曹昌誠偉傑歐伊恩高貴敏雅蘋鍾大睦趙樺偉梁聯賢葉柏男鄭仁凱朱明君仕倫顏劭宇國富騰毅鄭雲騰康家榮顏慶華高銘鋒宗育明昌憶元葉強曾子軒蔡憲文蔡憲文鄭佑軒蘇曉嵐何亮輝溫秉謙劉健榮群泯約農春輝瀚輝于國祥忠良俊雲蔡震坤婕妤方志明洪新閔靖曾子軒彥邦詹淑君朱希敏家維游哲勳俊廷榮定政邦世銘世銘世銘紋墩盈儒宥嘉欣中彥銘劉老虎琨元荃淳潘禮儒憲鴻章晉榮憲鴻杜品叡呂筱蟬蔡小姐蔡仕元蔡仕元姜義振盧上斌杜昆展捷德兆任忠信伍志豪晧侃睿愷呂家龍洪瑞泰詹鈞瀚詹鈞瀚逸誠江凱文劉秋富尤耀賢榮泰國貿守成宜妏葉書豪劉國章志展凌岩村莊育笙賴逸凡欣榮奕森蔡葉功慶勇程炳宏蔡孟宏齊泓翔靜慧立森沈宗翰毛垣申余致賢蘇庭輝大維彭善成劉家瑋劉益村錦昱郁獻誌霆豪文傅建源婕妤豐達建樺魏泰元家瑋曾勇智彥苹政鴻宥豪溫彥文鍾添錦鍾添錦鍾添錦鍾添錦書源熙哲奕豪鄭傑文杜育穎嘉峻韡衡鳳祥盈儒蔡蔡魏永興光道蕭大慶鈺宸鄭琇文尚緯劉柏均國榮蔡金謀浩毓育銓何旻軒姜義振曾建銘溫景棠安安莊志忠呂韋德子祥非凡銘樑弘軒弘軒溫振弘禹慶啟隆蘇庭輝家均一欣弘治泰芳馮誠琦默宇啟軒邱聖維其楠賴厚全鄭雲騰聖書律言葉智浩藍智宏蔡承佑宜豐志晟志敬曾明勇劉老虎祖武福勝軒宇軒宇劉俞宏瑩昌亮双正雄江筠遠瀚耀國又有高明新簡鄭明睿子賢哲賢子隆易易大哥劉老虎姜越廖健豪穎謙銘閎浚瑒顏志文蔡新冬世賢劉時瑋蔡資財莊映華譚寧翔瑀浩東哲杜桔榮弘輝莊飛燕建凱孟通鄭佑軒小全君彥晟原小皇仔志嘉鄧錦棠佳晉柳逸軒柳逸軒冠賢志達柯容和立普家豪洪明全俊宏廖昶銓劉修宏哲佑哲佑馬丁政邦簡毅翔玉宇曾振洲雲程鄭庭蓁鄭庭蓁江昱逵高豪聰鄭博修尚慶允聰思萍胖哥曹迪凱弘莛余奕輝游晉嘉文振沈俊龍詩宇銘鋒志哲曾世豐世炘蔡岳樺蔡玉鳳濟恩游勝恩錫威錫威沛生蒙治瑜孫立德孫立德哲誠哲誠德盛蔡小姐朝景彭建溢康家榮志和葉育睿蕭峰醇子成侯顯其劉文堯宏明小龍薛沛廷榮和宣毅聖弘俊志劉錫禎釋賢巧如游啓泰嘉訓鍾裕彬達昆伊祭潘柏源杜柏青尚慶葉曜瑲趙堉榕欣榮和安顏日威建隆薏喬炳宏天惠蔡政哲晟原智興玠理昆融朱仕宏廖伯偉游聲笠家宏趙國棟基田孫啟中曾振洲家凱晏佐馬吉辰耿祥白起豪翁瑋廷志仁蔡超聖釋賢英信勝天天惠宇樂思瑋劉祖誠簡至韋簡至韋簡至韋婷婷婷婷耀霆榮和榮和芷萱荊國泰胖哥威宇洪有來蔡嘉向耿志宜展信旭奕新詹文福詹文福冠霖劭愷葉庭志學儒智能昱翔奕銓宣文劉盈瑞顏日威振宗政衛勝恩明呈天惠奕維邱培澤鄭建邦賽皇昇佳曄政协律鈞子恆莫昆霖建志光宇詹惟如侯寧梁博凱史塔克趙經綸余靜怡穎蓁鐘祐威鐘祐威鍾怡芳勝安進勇維鈞蔡雨軒呂博宇刘毅然薛長浩趙曾建文劉繼軒簡國祐暐蔡明鴻昱荑乃木兰致弘弘凱魏毓廷賴哲瑜康自豪倉福小邱茂庭蔡嘉文國輝安百峰禮誠禮誠董昆哲小芬幼琴小璋蘇慶原佾儒廖益傑建盛蔡承諺世閎以賢證嘉佳蓉士源鸛華沈嘉龍明樺志誠志誠志誠金龍葉庭志世偉韓忠平曾增文廖宏毅曾勇智世賢鄧淑玲鄧淑玲邱名嘉簡禎佑朱良瑋杜宗城耿瑜邱俊瑋皇士宜妏柏遠江晉元温柏格庭瑞志昊統立娜佑欣民廖文遠泊汎禹慶志介禹慶魏慶元彥霖信宏慶宏顏世卿杰廷鄭期鴻阿信鳳梧志揚游惠郁曾志樺隆哥譽鐘譽鐘國偉偉傑崧濂家偉啟禎哲嘉崑鳳志彥曉群奇良語安常益志明景復祺瑋楚杰怡隆國源霈傑高進明柏良威諺立信雅淳蔡佳霖敦皓煌程裕軒邱奕穎巍霖仲儒建鉉邱議禾勇勝建邦邱義方蔡松霈峻宇信豊以昕延洲延洲江忠穎賴婉蓉詹哲豪劉曜境晉維詹哲維繼慶范信安劉智行鍾昀諭沐錦彥州葉歡葉歡石豐嘉沈光宇庭尉洪偉倫柏勳戴哲南賴宇政蔡獻毅琬婷蘇啟元洪晞峻秉峰何嘉倫俊哲宥鈞律衡道森洪敏夫新懿耿祥朱良瑋翠華翊寧仕騰蔡家鈞簡廷宇昭宏汪仁忠盧宏社梁子琳小西久雄水森哲宇洪勝雄志華長信劉雅文耿祥葉毅平丁重威游于二廖紹宇小姐祥豪聯恩慶合詹淯惠廖國三洪偉衽啟銘康勝壹詹志峰君偉歐政元石大剛宜倫曾聖結馬繼孔閻嘉龍蔡育明辜元泰喻奇武威鴻柏勛寧昌儒呂宥儒呂宥儒錦銘國世福源龍蘇雲龍車炎江游少軍鄭百恩鄭百恩宜輯元柄鍾天祐蘇冠儒潘秋旺柏慶昱潔蔡川忠鄭伊善朱俊奇育聖呂宗茂柔懿鈺傑魏茗洋何文洋碧珠孟修威豪邱禹睿鄭楝荄鴻戴成志駿宏劉素伶建芳潘子村彥彰世欣褚昇融時廷劉一新游忠翰何家銘詹絲羽威臣傅柏學進聰致逢彭合崙天霸瑋朱玉山昱忞文雄家誠劉靜宜世宗曹中健瑞賓態均姜文忠馬冠羽梓淵慶賢劉議文蔡智薇易永晨曾明瑞曾郁荏希明晉倫凱弘余永勝國安韋伶國安夏宗楨辰叡景泓淑玲涂靖章邱華斐崔宏興合俊紀強胡嘉文清河劉佳憲童加呈邱俊瑋咨亨善鈞榮崇朱正倫朱源科蔣勇暐志安天恩奕云國維洪和吉洪和吉柯瓊文秉諭景龍月國成劉議文秉諭宏德戴良鋭偉賢浚誠程翊修齊煜珉信楠劉武晃潘瑞信洪祉眑朱源科顧哲銘嘉銓建輝順興邱國勝彥璋邱嘉誠紀宏洪琮智丞偉丞偉清安桐聲顏宏益俊傑俊傑中琦聖為思遠鄭宇呈榛鈞梁召弘輝曾建豪正岳何蒼智鐸耀約翰顯南合憶龍孝祖金世峰建凱廖宏毅簡白永明簡金科何宗武高祥益盧進和江安家衍杰瑞冰保僑孫永昌維軒資堯博盛柏樺弘斌勝文曾友和唐儀軒皓安泓瀚進益永禾炳達子威燈瑤鄭順義東興永平鄭建志呂家為梁文典劉昌家祥懿宏德憲政姜越賴俊儒-建曄呂晉良廖淑麗薛彥祈奕承鄭天賜添壽忠昭綸廖經欣曾鄢昱胡嘉玲斐然宗諭尚宇啟銘文海洪偉衽家庭鈴潔駿賢鄭文鼎俊華梁恩迪光維國鈞劉康淳俊甫安豪文傑尚仁孟諺游宗霖鄭健川韓修武和宥童青峰何承季淳僅虹誼葉建豐煦峰偉傑裕義凱鈞朱建維鄧宇村鮑福光宗義一峰建宏志宏俊宏慶庭昂軒鄭國強清泉紀蒼任志和皇昇何啓洸邱煒超暐智志豪葉貴福佳蓉顯南嘉豪秉原鍾蔡明達坤志芳瑩洪英哲柯孟佑嚴偉綸常瑞恩趙俊欣顏景晨柯古琦葉金山傅祖佑映郡靖鈞水盛崇宇潘慶原傑冠志雷文軒進元廖哲偉胡哲彰立德盈日胡瀚仁文雄正耀健旭勝騰賴怡蓉蔡明樫廖宏毅培倫伯峰邱宇宏劉存海胡瀚仁志晟振義葉村夙冠凱明裕游志明煥傑聲毅順傑逸勳煥傑龔建霖連志炫賈夏磊宗銘蔡承志小西久雄健義定謙崇綱汪仁忠偉軒敬業克平蕭建銘文聰阿生冠合趙嘉豪沈嘉龍馮楷倫國強勝平偉民葉威平榮覺俊任游淑惠正明鄭世杰何政政傅裕峰勤智皓安育民明瑋姜越宗悅源星傅聖普廖建清翔姿瑩曾國松軒銘蔡孟峰東宏聰輝蔡文和桐聲桐聲冠志根標永隆和宥四賢宋仁成桐聲吉宏卓育劭鴻鄭宜玫昭鏞睿安宗勳承祐智華詹惟仁彭吉宏皇昇祐綸蘇政鴻文祥莉婷政柯君英琮傑郝振衣長富賴嘉偉辰廖佑寅政輝鄭簡郁銘亮凱世鴻長富潘孟璋葉耀元姚長志耿海超辜元泰朱桓君伯源建鋒孫恩宏旭紳克駿天育蘇宏仁葉逸勤鎮宇家鋐殷登泰嚴甯水森水森帛霖洪嘉和詹章明則穎培坤哲士廖家麟宇軒曾善澤游志明何研誌正文居順水森鉉台立普宏彰簡皇吉嘉豪威廷鍾永俊新哲潘沐澤多倫宣文方軒正威霆錢嘉琪方奎元昭元石益豐汪仁忠蘇天羽峰賢鈺華洪信隆翁英峰桂瑛亨斌偉誠志宏文博蘇錸星科技白秉權是你問問你催促紀蒼韋志葉政昇馬任寬景耀立峰聖懿廖宏毅宋政道宋政道邱聖弘方巍儒昌良顯南振峰趙趙承華秉豐光榮仕騰何杰恩蔡有佳以臣凱勛呂冠緹育麟毛俊清胡家駿劉志強顯南偉懿訓騏欣玟榤雅鳳佳蓉劉逸揚劉耀仁驄譯逸勳定和承顯偉倫阿良益清柯宗仁政甫鵬凱威宏中瑞兆逸勳蕭淑芬余定謀江筠阿良又有科超苗瀚允世偉泓逸榮富富棠邵均平洪星豪世臣建成建安義群哲鈞信傑濟華家豪大華姚敦凱一泓方世主范整炘文霖劉煌昌小姐顏照銓劉生葉豪中寰誠璋鄭衍志江亭誼國彬趙堉榕戴昇安熊偉辰公聖劉玉馨翰驄譯蘇志承彭宗高毓鴻銘永鴻鄭仁偉楷倫金德忠智華敦凡劉漢仁曾啟諭俊良承峻郁軫姚和俊宇唐鴻文胡鄭隆皓邱俊瑋明毅曾信堯禮忠榮祥鍾明宗登發淂豐濱何庭豪趙傳軒傳富葉靜倫江亭誼簡皇吉聰騰鄭小強方翰賢俊翊國富冠宏玟瑾卓建宏致宏宣羽佳穎邱俊瑋廖偉哲煜鈞劉政廷博仁永銘幸建蘇辜元泰光中温彥勳簡學鈞昭賢彥泊曾介鵬家富樹國曾清山邱文峰石豐嘉君豪宏舟洪韋丞沈秉賢福河劉孟瑋梁庭嘉俊樺丁小姐志成顏百駿鄭智仁顏百駿紹宇呂晉賢志安劉明強下單杜得瑜威霆耿祥東哲劉士豪劉家銘蔡亦桐鴻德文豪文琴蔡盛旭柏村事鈶佾章佾章玉君銘紳呂健銘譚立軍朱涵如韋霖廖宏毅沈育霖劉育禎冠志炳彰劉德裕于耀琪劉耀隆耀德崇淦譚鴻震裕峯智程印沖偉棚譚晟勝俟鼎智博勳建穎葉詹建彰段繼忠小西久雄瀚年亨江亭誼政軒姜志龍光義心業東立家森賴大年津榕學鈞澤甫奕銓振昌簡英彥賴春樹賴春樹其益頌憲麗環培倫銘聰則瑋資原日農世超游振陞簡宏隆曾廣基皇昇泓渝銘紳葉永豐德偉洪昆憲鄭傑夫文雄莊文和穎傑紀蒼藍勻廷柏勛劉家銘維鈞偉杰方照歐明謀葉文德偉祥鼎智佳蓉政恭蘇天羽偉杰蕭庚致丁志叁仲翊葉永豐鄭維瑜莊文和鼎赫洪敏夫洪曜津巨安嘉宏思諺蔡易龍驄譯建誌偉平魏建樺籃文明庠橙邱碧彩柏甫文慶彭和駿仲泰忠吉蔡淳羽莊夏志由富紀宣榕畯富龍宗贊仁展維思孚戴爾公司盛信賢福藍秉樺寬政國樑-邱儒伯進益政原建倫皇志蘇偉帆游志明瑋湯凱傑方欣偉暐建龍綺芳潘緯綸炳煌瑞帆志強正雄潘永陽嘯天顯南欽煌佾章莊庭維龔小平孫柏茌智麟祖武孫振民唐弘勳程郁凱智正戴璟昌江岳澄蔡清雯睿翔佩詩志祥葛燿鳴永竣松濤銘紳裕昌小凡偉涵立普洪小雅范姜世泉小姐路正趙嘉鈞彥崴翁鴻慶廖正賢上太仕杰溫大瑋潘天慶品綸星豪曹昌福岳奇祖衍正忠日農志虎懷威鄭澤駿譚馳雍俊硯邱彥焜廖紋駿皖婷曾新權劉士綺彭葉受榮詹裕程楷元鎮國妍樺童正安韋源樞光贊升何啟宇蘇建焜于萬新劉崴蔡剛正冠廷劉源進蔡承宏賴煜凱洪仲輝建榮賢福宣文銘紳鑫旻冠志庭瑞梁麒麟孟祥裕登發銘生志智世育蔡何昆瀚祥舜凱勛白君彥智煒欣思嘉彥如廖克強璟灝朱淇隆劉源進皇昇邱嘉慶廖宏毅政恭證種力升樵煒賴正偉朝健文銘琥瑞胡瀚仁力文鄭秉昇嘉新曾志峰鉞升鍾葉建鴻下單恆嘉煙偉廣松文彥川山歐庭安昆霖傅慶彰圓智金仁遠崔元俊蔡學孟皇德佩芳汪聖翔紀孟杰智忠木水宗瑞俊明嘉晉古凱宏致廷柏鴻洪守菘鄔旻軒田乃文江文翰振脩序魁元隆哲睿湯濟顯天惠蔡志遠小廖仁豐啟龍余建暉賀姿宜鄭富鴻中沛雅蘋得豪世昂畢建同彥慶賀姿宜文勝劉志偉集雲紀蒼傅盈勳呂玄義侯宜良硯志曹祥如沈柏傑信安江欣樺育民全適達蕭鄭宇呈哲維宇哲昆益韋廷凱智又心天祥劉昌諺博彥魏郁晉彭廖育彬台英鄭宇呈彰哥柏良阿彥書玹富任姿琪賴彥傑證懿松壽光華琨笙思傑啟仁達仁智傑玠鋒廷政傳富漢維朱熙廉嘉龍龍興顧彬志榮志軒星茂余國訓玉德唐辰藍翼光家豪銘紳政達衍皓君豪于萬新適銓沈寬偉宗翰謄瑤晉誠劉志偉以俠政傑彥龍永豪宜泓家閎立普皓翔奕玹劉志偉廖顯義潘亮羽光宏吉新金蓉亮丞柯拉克育慧詹宗翰蔡祐銓謙茂慎中尹健威祝庭輝晏安顏文輝沈建志小西久雄嘉鳴廖月艷洪振珽東興威豪世平英奕金株廖捷睿克宇振壹百祥何伯晟政安廣堯鄭元凱孟學致偉方文康紀蒼倫效憲顏百駿葉書維登發松岡義人廖宏毅益清廖宏毅曾宣達傅凱彥然博嘉鴻宴銘瀧亘彥緯銘紳蘇建元沈修安品逸麗川美怡江鶴翔史偉龍劉東荃潘名亮銘紳劉初來家豪嘉柔冠樺顏啓峰潘豔蓬邱莆鈞京倫天治清俊蔡旺璋邱慶祥力元侑頡亦玄孟翰呂文瑞鄭翌村崴宇維蒂巫宙潘宗賢俊鳴其宏宇霏頌嘉世昌翁宗民何昇翰蔡名迪鄭彥勳孫安南傳智志鑫政穎家德國釗邱子瑜左世昌下單下單家佑銘紳廖翊亘宏基翁志立游東道莊國華嘉欣新和宜為簡金科顏崇陽世弘威志智蕭嘉程葉洪彥勳鄒孟玲倪时航顯南金漢立皇閔梁國棟鍾有綸倪瑞德鄒孟玲智仁范寧潘冠華馬文生溫貴福下單下單駿棠丁瑋亞華文賢承繹文霖聖強蔡均懋姜維中傑緯豪浩平宋漢中葉仁琛長嶽新安建志洪敦揚彭冠霖闕逸祥賴聖憲亞魯赫秉植鄭如君廖國龍銘紳江穎劉威志立普瑋建榮廖宜瑨豪剛泓銘世光珮綾銘紳簡尤家輝志達紀蒼明哲江棅芢欣宏政恭葉泓毅小西久雄丁頁富彥徵葉璨綿馬武陵姚志隆士賢廷瑋文賢盧怡良祥聞姜越昱帆建建魏平倫致彬洪敦揚正勳鄞振明沈欣樺徵宣文賴柏憲戴士凡維帆睿豐何叡光正耀壓根于營滔方經綸文益賴秉杰有義福財何敬男甘鶴彬翁銘裕劉俊宏江宜穎梁德祥奕揚明程傅盈勳劉欣頤石經理鄭偉智銘紳蔡嘉文養信劉建麟賴炳羽葉蓁盧冠志莊皓倫江松燦雲翔宏文朱建宇少宏肅卿世欽劉榮棟洪敦揚品辰策世丹聖文天寶戴騄成孟修成瑞程孟修谷樺柏廷卓致辰敬庭柏憲鍾賢達孟珮倫紹安游鈺崧阿偉聖文劉德權楠紘賴穩曲賴穩曲江秉祐姚美齡榮銘楚杰戴妤芳杜英傑志謙伍安民胃文汶文金土康峯銓永富先龍姜義坤莊婉紋冠淳鄭睿順曾援能姜彥任英助適名簡廷宇賴謙成劉簡金科誌峰可文亞億兆鄭睿順哲瑜劉國訓丁專益蔡旻凱渥蔡旻凱曾威翔劉宥佐宗龍晉堯馬裕超蕭東兆渥恕弘鄧瑞軒高國彧家誠信義博建何威君邱威傑士銘賴朝俊國駿振宇詹至譯廷嘉鄭品淵蘇建嘉湚珵建全相霖玉麟歐迪穎庭彥皓麟柯宜宏鴻裕敬堯習道寬俊璋劉耀隆志偉劉武信忠平奕寰晃小江江亭誼翁家傑玄旻邱耀揚孫偉騰孝森宥嘉長嶽育誠佩璇宥瑋佩詩奕安資斌柏瀚孝鍾登凱孫惠民承銓建霖鄭柏滔劉柏良邱苑玲莊景梁森雄恭葆皇昇添照庭智劉志啟劉志啟宜廷冠志韓誠旻廷君濤潘正義國鎮彥德簡佳緯建德曾偉劉重楷趙磊杜英傑智謙劉柏良俊霖益珉森雄鄭向均俊達博學丞毅宗翰魏君評孫安南德裕愷辰維倫振豪隆健温宗翰杜昌隆智寬莊如羚英瑋俊宏俊博鍾文曜翔逸鼎智莊俊霖聖育洪翊傑宗翰胡晉維登俊振宇賴威丞強生書銘曉銘宥羚建瑋均睿杞品毅德裕劉明憲鼎智策世丹鼎智銘紳在炫顏錦全乙棋孫安南博智顏勝龍廖宏毅紀皓翔博學俊毅哲維少甫萬根振宇彥璋國城亮竹俊達洪敦揚銘紳江育維溫文志宗慶蜀台蜀台蜀台連章潘厚誠義豐家民文哲宣撫和憲秉穎范翔益奕慶閻立元政文莊釗誌彭政鋒智禮葉佳進清泉賴柏良土傑聖文展昕政群軒老翁家傑子庭蔡麗芳潘冠宇劉重楷哲綸晉全威廷珀震慶倫凃士盛旻堉展榮維德冠華柏睿左世昌洪政昕葉蓁士倫品凱建旭柏睿輝朝廖俊宏俞士弘梁偉民坤南昇輝洪照詠薛丞宏曾崇寧曾彥欽柏睿洪子軒智興杜羿昕小麥凱立鄭達晏碩彥芷瑄游子孝志仁俞士弘佳宸劉建利石俊宏鈺益劉冠賢鍾嘉欣文振小西久雄蔡雨辰康博宇劉耀文竹硯鍾亦嘉魏麗蓮立普哲豪鈺靜岳庭麗慈弼琦登傑幼勤慶昇存立恒偉萌櫻紀蒼瑩鉅文忠甯葳呂翊誠瀚賴孟澤游勝顯洪依婷丁彥銘劉仁傑仲皓侯嘉寶紝幟金堯戴傳益廉加鄭人華盈江簡捷康博宇游文毅岳樺廉捷葉佾叡何永發洪一二書偉泰德江明樺柳嘉雄劉俊毅裕凱文徽尤文宏易昀廷英傑盧沛慈馬嘉宏柯名駿洪文進俊彥俊瑞偲萍文鍇文中益珉文中聖豪游清翔自強凱傑智宏何金賜宏年文賢國棟慈悅勝翔董冠甫簡金科朱柏濬魁文正和蔡貴元榮生白淳升登笙立陽彭炳耀媛婷潘素秋沈鈺恆賴迪佑一朗慶鴻古志峰彭永翔家瑋全慶家豪洪敦揚正倫逸楓育安田文杰魏大鈞仁煊方彥翔唐杰綸鄭雅尹劉文楨葉哲宏余松錞大軍宋依霖勝賢蕭瑋成劉宇恩勝凱何其晃俊儒弘力莊岱昕莊岱昕蔡鈺發劉順樺賴宏維洪可耕椿發政鴻賴長慶蘇弘愷龔志宇祖勤牟庭駖劉幃軒俊鳴葉哲宏寶星余博印呂柏融劉怡伶江瑞芠秉治世瑋立澒江達立蔡志昌詹至燊建翰唐銀藜仁邱秀敏汪之光詹至燊智翔彭呈翔梓豪洪江源雷孟勳仲柏俊智廖彥銘顥騰邱鳳麗勞倫斯鄭國棟育正忠謁詩華尤文宏瑜永昆偉傑葉凱軒曾乙城英瑋高怡君曾羿碩惠敏雪美庭毅景樺呂尚恩顯南賴睿廷柏翰劉理劉學儒文龍田偉棋馬驊趙家賢魏至軒邱遠志江明倫慶鍾魏巍憲國茂年彥旭家豪喆宇志宇游鈞量朱韋丞志銓方瑋禎鄭光志蘇睦鈞翁思源柏銓浚嘉翁思源仕全蔡珮真鄭仲堯小鵬珳翔靖瑞朱建龍立成正雄邱學柏侯盧楷曄清正文平克心億兆柏銘柯名駿芳民汪政諒柏愷俊銘啟桐承洲劉長安劉一德維倫立陽家誠弘銘小朋俊璋義和詩華志豪俊憲邱天相億兆高偉閔靖瑞廖佑冠侯宗佑何雅德智傑柏程振仰孫善同簡郁銘宣文高鍾立文薛曜俊萩浩瑋賴威權譚丞硯光瑜魏維辰翁政裕高主義呂方文蔡振易育安柏銘哲瑋哲瑋柏銘茂盛郁昇成昱翰蕭宇翔德成炤均鄂明逸文翁家傑一崴鄭琇文柏豪姜越鄭宇哲游晨聿一輝婷宇政偉志豪曾冠憲匠君閔誠孫泱愷葉坤山廖松柏又有聖文余卜康邱博晨曾鈞彥沛程中銘鎮仰國郡蔣圳雄信義傅盛濂俊和尹向榮盈凱世界拿倍銜田偉培銘家豪安迪曾煥庭呂旻哲國基志豪孝揚趙尚宸宗偉紀宏達劉柏辰顏佑哲廖宏毅金池祝成偉簡嘉星得祿瑞昇洪國玹何松融洪憲明劉映辰霖棋宣宗劉士豪賴莉珺劉議鍾呈謙牧山博文蔡育菁沅杰簡金科蘇陸皇成昌軒銘谷嘉榮劉里斯游雅芬時庭偉銘范秉然蔡宗祐柏丞薛游士弘韜玄江明樺昭仁凃偉強丁朝龍潘之樺怡銘戴翰簡龍德明誼宗毅孟忠趙泓聖敏哲志宇邱美玲簡永森俊硯劉育誠賴盈州軒宇冠宏盛志達志豪炳宏宗憲谷淳月華晉慊坤誠俊豪政欽博文姜賀賢時新傑劉明哲簡偉晉尤文宏劉孝偉京翰易叡文章勝俊夢坤廖鴻勳藍文屏英凱玄尉鄧惟中琬蓉韋諺建潪煒傑俐縈元一立騰謄瑤熙翔鄭浩天定恩齊國興謄瑤奕璇劉芳妤葉育良鄭名凱金凱軍蔡長杰致微韋勳賴盈州蔡昆達鄒宜辰弘傑斯瀚江乂芢長瑞皓偉朱晧暉賢良洪正宇高宏銘世德賢良克剛喬雨軒姚政仲上豪松柏睿蕭銘偉鍾招宏恩蔡帛翰胡明翔柯智元勝安國興沅杰錫坤優良進貴絨希哲宗芳藍耿學葉芷妤朱白青信憲清漂謙策世宏慈雲政豪瑋華振昌懿哲軒宇裕森方建勳緯正正勳邱明堂漢俊鐘艷庭猷舜國駿俊廷方國定劉宴伶唐翊龍劉紫蕎心怡凱祥寬仁賴家偉懿家劉洸宏蔡庚哲祐宇何雅德趙學昶邱文明關明雪俊彥胡姚俊傑韋翔以諾智冠洪翊傑怡萱葉蓁鍾立文松展劉澈明勳浩廷政衛葉蓁呂昆洪劉雅文振軒家豪宗芳閎翔余啟南昇洲錦芳柏君世偉盧泰霖勇程家賢戴如郁詹凱傑子恆蘇翊宸興華孫嘉賓學毅胡智豪品翰洪福成政鴻蔡名宸于柏元柯彬文國良念祖簡志鵬劉家瑜連家毅蔡世毅洪堯日映潮江東衛江洋碩彥俊琦德隆呂立鵬思元傳品辰上宇天進方睿喆邱盟盛炳辰大華田杰恩淞億建樺玟伶佑宸榮生趙祥志政哲佾章潘素秋國郡溫智宇茂有智偉唐裕松蔡育智瑞麟恒立榮浚蔡宏思維賴宸浩宇崙賴謙成蕭文俊洪家靖仲康哲倫志彰彥夆蔡竣富一儒恒立潘素秋建華廖榮欣承陽志誠凌志梁火煌姜睿楷龍宗紀蒼小西久雄宥鍀賴宸浩游振明潘雋杰旻航銘宸源平梁翰銘江政浩裕森智翔曾昭銘博維必啟惠珠英杰億兆敬堂彭聖超岑熹聖文邱智清瑞材宗泉妙宜良谷國峯家源方培宇裕森蔡尚君蔡尚君佾章翁瑞榮彭乙軒維銘朝偉昱頡蔡瑞豐佳宸歐宇翰俊廷呂彥樑劉思良劉順樺庭偉凱泰養齡鄧琮霖范彭乙軒洪呈玠俊燁簡嘉甫鄧旭昇家豪勝輝甘圓圓何育仁孫崑圳柯金全穎霖明隆于捷睿豐錫海游子孝群諺蔡旭捷宇軒謙琦方頌仁魏嘉宏麒誠耿誌賀顯翔蔡坤男雅博毅翔全廖盈嘉劉晉安俊達莊岱昕文傑財興國峰亮宇鄭羽軒鄭羽軒珮瑄承修何永發姚振傑藤澤哲也朱承祐明志希諺嘉成威宏大鑫鑫正心靖瑞宏彰曹懷元蘇科錩世祥志偉呂欣哲呂秀珍億兆珂仰阿萨德蔡游順堯峰銘葉佾叡策釋丹邰聖淵成瑞程尼克英瑋劉國訓琮凱任佑晟佾章弘傑尤文宏錡鋒亞太策誓丹佾章健翔蔡博宸呂天睿忠堅冠閔聖文胡瀚仁沈柏呂定鍇佳君魏德倫温傑分尤文宏冊世丹鄭永健博任呂曉峯高文民冠中顏劭宇鴻欸奕凱立普宣崴蕭淵伊余士迪劉景琪偉丞宣齊尤文宏東揚尼克洪炳煌簡翁秀足立蘇念祥梁實緯世任呂柏御唐寶至恩莊世鴻尤文宏韋勳劉勝緯喬伊智偉富仲廖宏毅蘇仁彥方耀興曾俊雄劉俊傑久謙啟聖曾郁凱文宇映潮士倫仁基豐震賴盈州賴柏仰建鈞皓宇忠銘尚昇潘泉銘洪浩禹智偉竹恩永昌胡秉銪詠盛明鴻智勝沈帛伯常予凱傑志忠家興耕睿蔡岳軒尤文宏柯政儀顏妤安祥辰蔡炳烜弘銘沈瑞慶柏瑋銘輝馬文淵蘇培超慈良文傑相鄰策士丹淵智阿堯曾國安尼克甲任建森世勳偉任東文泰維哲南真実奕佑信輝程鉦元光明鮑松諺麗安佳明宗益朱皆居子榮曉蓉蔡日偉祺哲龔家祥余文鈞曾裕智永輝廖奕勛落隆凱文雄建良斯為蔡鴻明賴俊龍汪曜誠炎生建志博勛佳君銘維翔尊宇育鈞才授蔡宗澤軒豪博勝翁志峯蔡順德勝雄宗志賴昱銘國華崇維劉昊蔡天錫詹政達大有水松宇秦魏振雄珂仰蔡宗富賴小州淳智盧智賢陸仕傑于誠應華杜寅生銘尉翔孜謙奕翔秋膺維祐梁春鴻文忠梓齊詹益永定詮邱亭蓉英德蔡博宸吉米侑達袁袁余維桔佑齊邱文吉洪堂浩皓宇余宗叡平富江達立凱臣游宏銘鄒曜隆金克寧瑜銓宗芳廖忠諺曾彥融江延真呂宗駿莊政諭賴彥銘宥瑜盧浩何耕任明暢莊重湘琳源春丁少剛文政沅鴻鄒嘉成國安蔡政儒詹益永蘇漢評運盛昆厚文賢詹昇諺程洋飛旭詠淮勇達修岳明豐樂恩宇逸文哲魏仕帆從瑜耀仁詹益永詹益永劉鴻瑜小民游蔡易儒翁尚鋒柯信宇劉少凱蔡育揚裕翔小芬詹益永盈甫賜美文蔡尚恩桂潤臣耀德佩真璽翰龐明祐簡哲梁春鴻宏達禹臻麒翔孟琪揚泳陞劉國兆煜翔斌宏戴明坤文成仲齡怡瑋曹順財詳康志遠鄭宇凱宗祐一中簡閔謙天鶴家丞玉娟宗祐奕叡呂朝陽湯川賢文賜美翁國郎曹順榮政陞俊吉家揚魏志宏宥達楷鈺裕淵彥誠傅京傑柏璋說煌何宗庭俊傑莊勝超康志遠廖英杰健廷明盧致維俊祥志昇明忠歐聲源宗吾葉育良蕭湘廷蔡易澤呂清愷安伯謙勁喬高啟賓子威翌峯翁偉評劉偉明馬女士田文杰江允睿邱雅琳士杰翁士雯佳凡蘇怡穎朱字濠祺瑋蔡易澤簡勢城家豪天侑蔡偉杰曾精才岳樺劉定芳辛美誼弘傑鄭耀宗天惠偉誠劉豐碩賴駿翊至軒家瑋何昕諺俊德育誠品嘉泓瑋石孝榮政維尤文宏歐坤彬方志峰慶龍游志明盈延辰煦怡婷巍仁政柏書程秉洋高瀛鴻鄭元凱廖耿言盧志賢蕭柏千鼎雄蔡宗翰志鈺江愷威俊松江國瑞安隆余振豪國桓涂永義廷緯鄭智沅巧麗邱博晨柏榮邱證瑋緯綸欣孟簡閔謙萬翼彰賴麒暉邱雅琳洪嘉佑蔡易澤賴宜詮志瑋銀旺詩偉趙建發胡進生卓建甫偉平廖俊惠俊雄書瑛哲宇淳智浩傑胡育傑文聖孟賜浚頡志豪詹坤諭宜杰沛程詠翔潘仕賢呂金泞龔倍晃裕新賴柏岑智禮彥丞昭貴永欽志強鄭煜勳趙志騰簡文杰姚政仲家進家誠劉進榮承璋浩賢劉嘉官劉家甫坤彬談胖孟濬廖柏翔董力誠邱栢霖子文詹翔皓君豪冠廷威豪邱啟智洪佳則魏華慶秋明聰寓棋春秀春明春春葉烜睿明璇游景澂魏仕帆冠廷江榮葉家豪游台順柏良宏敏鄭文杰東磬邦彥劉景桐宣宇敬民德華相涵涂少邦胡承良柏元方培宇文彥哲漢建明均愷智允江啓志曾志祥蘇志揚亮廷學暉朝健建蒼馬志明邱春春明倫韋勳志偉政維閔生啟賢梁軒瑋宋至正晧駱昱翔明宏政維志瑜彥廷姜丞洺曾偉鈞智凱玉祥學坤莊立暐梁凱貞永昌祐民簡定緯原呈軒宇詹文彬詹文彬昇泰聖平范益軒旻儒蔡有全顏立成翊綸呂懿哲丞佑萬家慶莊東榮明宏顯南冠達姜丞洺誠濱世儒俊成游順堯翌峯曾晨廖宇倫志鈺文杰得祿志賢高捷蔡慶德舜齊賴輝榮鄭棠壕保富洪嘉萬吉湯家紘蔡佳蓁華展思文玉蓮佳龍韋勳葉佾叡劉俊鴻譚任翔劉順樺生中廖家賢安安開心俊良詹家豪聖珽莊浚佑庭凡信樺賴昱銘偉嘉劉嘉仁鄭瑞卿胡國明呂逸奇顏盟軍嘉永盧佳俊宋永世鍾浚騰邱聖毅洪綉敏昭華蔡東勳魏永興廖杰夫育瑄歐鍾明華顯南邱縉騰茂霖鍾仲文洪秋竹江明樺昱亘春池秉達袁明宏億榤欣達昀興侑濬敬威柏偉豐嘉鄭哲倫重志永昌歐于雍菀倫賴昱銘思齊哲綸鍾志平連夷佐庭維韋勳閔龍曾俊偉炳均維宸建豐軒轅昌駿尤文宏彭志賢東昇韋彥柯冠宏呂學彥昱嘉政傑宥穎晉誠義龍翁秀足政鈺蔡易霖平和詹嘉瑋麗夙劉晉安劉嘉能善炫均岳鋭熹胡進生簡正評育瑋簡閔謙胡進生高永晴俊儒智端達小西久雄家豪賴志杰蘇煌文峯豪明宏劉明哲煒竣昌哲炯廷健毓子軒志明丁酉包爵豪文峯宗庭志賢柯宏忠榮興劉建志簡順光世平世強志賢鋭熹洪忠文洪劉桂欽堯簡閔謙劉桂欽啟維石豐嘉志強群諺劉順樺彥超儒聯游台順孟樵魁雄坤山蕭智元宗佑阮翊銜蔡有利野平明宏簡閔謙鄭又淳姚俊羽蘇星旭游振明石豐嘉蔡建弘胡秀芬凃匪簡子綾煜翔俊豪允浩饒敬穎景為宗進浩銘戴志宏均翰文慧何志剛威廷寶戶莊文壽葉永鑫珮瑜品豪郁晨萬榮貴田恭宇孫蘇崑楙曾泓進方利瑋紫縈宋旻遠宋旻遠彥德達源';
                        preg_match_all("/./u", $name_str, $arr);
                        $as = $arr[0];
                        $num_nick = ['1','2','2','2','2','2','2','1','2','2','2','2','2','2','2','1','2','2','2','2','2','2','2','2','1','2'];
                        $nick = $num_nick[array_rand($num_nick)];
                        $nickname = '';
                        for ($i=0;$i<$nick;$i++){
                            $nickname .= $as[array_rand($as)];
                        }
                        $insert_data['name'] = mb_substr($insert_data['name_origin'],0,1).$nickname;


                    }
                }
            }catch (\Exception $exception){

            }*/

            $order = $this->model()->create($insert_data);

            $order_product = [];
            $time = date('Y-m-d H:i:s');
            foreach ($products as $item){
                $num = 1;
                $order_product[] = [
                    'order_id'=>$order->id,
                    'product_id'=>$item->id,
                    'product_name'=>$item->name,
                    'product_img'=>$item->img,
                    'number'=>$num,
                    'unit_price'=>$item->price,
                    'total_price'=>$num*$item->price,
                    'product'=>$item->toJson(),
                    'created_at'=>$time,
                    'updated_at'=>$time,
                ];

            }


            if($order_product){
                OrderProduct::insert($order_product);
            }else{
                throw new MsgException("提交失敗，提交數據有誤");
            }
            return $order;
        });


    }

    /**
     * 获取商品信息
     * @param array $ids
     * @return mixed
     */
    public function getProducts($ids = []){
        return Product::whereIn('id',$ids)->where('status',1)->get();
    }

    /**
     * 计算商品总价格
     * @param $products
     * @return float|int
     */
    public function countOrderPrice($products){
        $product_total_price = 0;
        foreach($products as $item){

            $product_total_price += $item->price;


        }

        return $product_total_price;
    }

    /**
     * 根據IP獲取今日下單數
     * @param $ip
     * @return mixed
     */
    public function getDayIpOrderCount($ip){
        return $this->model()->whereBetWeen('created_at',[Carbon::now()->startOfDay(),Carbon::now()->endOfDay()])->where('ip',$ip)->count();
    }


    /**
     * 生成订单号
     * @return string
     */
    public function makeOrderNo(){
        $no = date('YmdHi').rand(1000,9999);
        $order = $this->model()->where('no',$no)->first();
        if($order){
            $this->makeOrderNo();
        }
        return $no;
    }

    /**
     * 生成内部订单号
     * @return string
     */
    public function makeOrderInsideNo(){
        $count = $this->model()->whereBetWeen('created_at',[Carbon::now()->startOfDay(),Carbon::now()->endOfDay()])->count();
        return 'R1-'.date('YmdHi').'-'.($count+1);
    }
}
